<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .div1 {
            width: 200px;
            height: 200px;
            background: blue;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .div1 div {
            width: 50px;
            height: 50px;
            background: orange;
        }

        .div2 {
            width: 200px;
            height: 200px;
            background: blue;
            display: flex;
            justify-content: space-between;
            flex-direction: column;
            align-items: center;
        }

        .div2 div {
            width: 50px;
            height: 50px;
            background: orange;
        }

        .div3 {
            width: 200px;
            height: 200px;
            background: blue;
            display: flex;
            justify-content: space-between;
            /* flex-direction: column; */
            align-items: center;
        }

        .div3>div:nth-child(2) {
            flex-grow: 1;
        }

        .div3 div {
            width: 50px;
            height: 50px;
            background: orange;
        }
    </style>
</head>

<body>
    <p>两个盒子的左右布局</p>
    <div class="div1">
        <div></div>
        <div></div>
    </div>
    <p>垂直水平居中</p>
    <div class="div2">
        <div></div>
        <div style="background-color: lawngreen; width: 150px;"></div>
        <div></div>
    </div>
    <p>三个盒子的圣杯布局</p>
    <div class="div3">
        <div></div>
        <div style="background-color: lawngreen;"></div>
        <div></div>
    </div>
</body>

</html>